<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #outer {
      height: 300px;
      width: 300px;
      margin: 20px auto;
      background: red;
    }
    #inner {
      height: 200px;
      width: 200px;
      margin: 20px auto;
      background: green;
      position: relative;
      top: 40px
    }
  </style>
</head>
<body>
  <div id="outer">
    <div id="inner">
    </div>
  </div>
  <script>
    /* 
      over & out
     */
    /* outer.onmouseover = function() {
      console.log('outer over');
    }
    outer.onmouseout = function() {
      console.log('outer out');
    }
    inner.onmouseover = function() {
      console.log('inner over');
    }
    inner.onmouseout = function() {
      console.log('inner out');
    } */

    outer.onmouseenter = function() {
      console.log('outer enter');
    }
    outer.onmouseleave = function() {
      console.log('outer leave');
    }
    inner.onmouseenter = function() {
      console.log('inner enter');
    }
    inner.onmouseleave = function() {
      console.log('inner leave');
    }
  </script>
</body>
</html>